<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">

        <!-- 注册全局组件 第三步 -->
        <mydemo></mydemo>

    </div>

    <!-- 注册全局组件 第二步 -->
    <template id="mydemo">
        <div>
            <h3>mydemo---- {{"烦死了"}} </h3>
        </div>
    </template>

</body>

<script>
    //注册全局组件 第一步
    Vue.component("mydemo",{
        template:"#mydemo"
    })


    

    const vm = new Vue({
        data: {
            title: "子传父"
        },
        methods: {

        },
        mounted() {
            document.querySelectorAll("title")[0].innerHTML = this.title
        }
    }).$mount("#app")
</script>

</html>